package algotithm.interview.shoppee.test1II;

import java.io.*;

/**
 * @author zhouyanxiang
 * @Date 2021-03-2021/3/17-16:44
 */
public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out));


        String s = reader.readLine();
        String t = s.replaceAll(" ","");
        String[] arr = t.split("\\,");
        String v1 = arr[0].substring(1,arr[0].length()-1);
        String v2 = arr[1].substring(1,arr[1].length()-1);

        int version = cmpVersion(v1, v2);
        if (version == 1) {
            writer.write("1" + "\n");
        } else if (version == -1) {
            writer.write("-1" + "\n");
        } else {
            writer.write("0" + "\n");
        }
        writer.flush();
        writer.close();
        reader.close();
    }


    public static int cmpVersion(String v1, String v2) {
        String[] num1 = v1.split("\\.");
        String[] num2 = v2.split("\\.");
        int n1 = num1.length;
        int n2 = num2.length;
        int i1,i2;
        for (int i = 0; i < Math.max(n1,n2); i++) {
            i1 = i < n1 ? Integer.parseInt(num1[i]) : 0;
            i2 = i < n2 ? Integer.parseInt(num2[i]) : 0;
            if (i1 != i2) {
                if (i1 > i2) {
                    return 1;
                } else {
                    return -1;
                }
            }
        }
        return 0;
    }
}
